package cn.bupt.adt.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bupt.adt.dao.autogenerate.RechargeLogMapper;
import cn.bupt.adt.entity.autogenerate.RechargeLog;
import cn.bupt.adt.entity.autogenerate.RechargeLogExample;
import cn.bupt.adt.service.IRechargeLogService;
@Service
public class RechargeLogService implements IRechargeLogService {

	@Autowired
	RechargeLogMapper rechargeLogMapper;
	@Override
	public void addRechargeLog(RechargeLog rechargeLog) {
		rechargeLogMapper.insert(rechargeLog);
	}
	@Override
	public boolean isExist(String trade_no) {
		RechargeLogExample ex = new RechargeLogExample();
		ex.createCriteria().andTradeNoEqualTo(trade_no);
		return !rechargeLogMapper.selectByExample(ex).isEmpty();
	}

}
